<?php
include_once 'mysql_connect.php';
if(isset($_GET['uid_mess']))
{
	$uid_mess=explode(',',$_GET['uid_mess']);
	$uid=$uid_mess['0'];
	$mess=$uid_mess['1'];
}
if(isset($_GET['uid'])){	$uid=$_GET['uid']; }
$photo=mysql_query("SELECT `photo` FROM `bbs_member_infor` WHERE `uid`='$uid'");
$photo=mysql_fetch_array($photo);
$photo=$photo['photo'];
$infor=mysql_query("SELECT `class`,`username` FROM `bbs_member` WHERE `uid`='$uid'");
$infor=mysql_fetch_array($infor);
$class=$infor['class'];
switch($class)
{
	case 1: $classn='会员'; break;
	case 2: $classn='高级会员'; break;
	case 3: $classn='白金会员'; break;
	case 4: $classn='版主'; break;
	case 5: $classn='管理员'; break;
}
$username=$infor['username'];
if($class=='4')
{
	$forum=mysql_query("SELECT * FROM `bbs_forum` WHERE `fmanage`='$username'");
	$forum=mysql_fetch_array($forum);
	$fname=$forum['fname'];
	$fmanage=$forum['fmanage'];
}
$new_members=mysql_query("SELECT `uid`,`username` FROM `bbs_member` order by uid desc");
$new_members=mysql_fetch_array($new_members);
$new_member=$new_members['username'];
$max_uid=$new_members['uid'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数据库设计_微型论坛</title>
</head>

<body>
&nbsp;<img src="<?php echo $photo;?>"  width="50" height="50"/><font color="blue"><?php if($class==4 && $fmanage){echo "<font color=red>$fname</font>版块的";}echo $classn;?></font>:<a href="my_zone.php?uid=<?php echo $uid;?>" /><font color="red">&nbsp;<?php echo $username;?></a></font>
<?php
/*开设版块的权限*/
if($class>=4){?>&nbsp;&nbsp;
<a href="show.php?forum=<?php echo $uid_c="$uid,$class";?>" />
<font color=green>开设版块</a></font>&nbsp;<?php }
/*删除ID的权限*/
if($class>=5){?>&nbsp;&nbsp;
<a href="show.php?delete_id=<?php echo $uid_c="$uid,$class";?>" />
<font color=green>删除ID</a></font>&nbsp;<?php } echo "<font color=green>$mess</font>";?><hr />

论坛会员数<font color=red><?php echo $max_uid;?></font>&nbsp;&nbsp;
欢迎新会员<font color="red"><?php echo $new_member;?></font><hr /><br />

<?php 
$show_forum=mysql_query("SELECT `forum_img`,`fname`,`fid`,`fdescription`,`ftopics`,`fmanage` FROM `bbs_forum` order by fid desc");
?>

<table border="1" align="left">
	<tr>
		<td width="133">版块名</td>
		<td width="122">主题数</td>
		<td width="163">版主</td>
		<td width="328">板块描述</td>
	</tr>
<?php
while($fname=mysql_fetch_array($show_forum))
{	

	$fmanage=$fname['fmanage'];
	$fmanage_uid=mysql_query("SELECT `uid`,`class` FROM `bbs_member` WHERE `username`='$fmanage'");
	$fmanage_uid=mysql_fetch_array($fmanage_uid);
	$fmanage_id=$fmanage_uid['uid'];
	$fmanage_class=$fmanage_uid['class'];
	if($fmanage_class<4)
	{
		mysql_query("UPDATE `bbs_member` SET `class`=4 WHERE `uid`='$fmanage_id'");
	}
?>

	<tr>
		<td><img src="<?php echo $fname['forum_img'];?>" /><a href="forum.php?fid=<?php echo $uid.",".$fname['fid'];?>" /><?php echo $fname['fname'];?></a></td>
		<td><?php echo $fname['ftopics'];?></td>
		<td><a href="my_zone.php?uid=<?php echo $fmanage_id;?>" /><?php echo $fname['fmanage'];?></a></td>
		<td><?php echo $fname['fdescription'];?></td>
	</tr>

<?php 
}
?>
</table>
</body>
</html>





















